<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
	<style type="text/css">
		table{border:1px solid gray;border-collapse: collapse;}
		table tr td{border:1px solid gray;width:100px;}
	</style>
  </head>
  
  <body>
  <table border="0">
	  <c:forEach items="${users}" var="user">
	  	<tr>
	  		<td style="width:300px;">${user.id }</td>
	  		<td>${user.userName }</td>
	  		<td>${user.passWord }</td>
	  		<td>${user.age }</td>
	  		<td>${user.gender }</td>
	  		<td><a href="<%=basePath %>user/${user.id }">查看</a></td>
	  		<td><a href="<%=basePath %>user/${user.id}/update">修改</a></td>
	  		<td><a href="<%=basePath %>user/${user.id}/delete">删除</a></td>
	  		<td><a href="<%=basePath %>user/${user.id}?json">JSON</a></td>
	  	</tr>
	  </c:forEach>
  </table>
  
  <hr/>
  新增 <br/>
 <form action="<%=basePath %>/user/add" method="post">
 	用户名:<input type="text" name="user.userName"/><br/>
 	密码:<input type="text" name="user.passWord"/><br/>
 	年龄:<input type="text" name="user.age"/><br/>
 	性别:<input type="text" name="user.gender"/><br/>
 	<input type="submit" value="新增"/>
 </form>
  </body>
</html>
